package com.cloud.test.cloudribbon.biz;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class HelloServiceImpl implements HelloService{

//    @Autowired
//    RestTemplate restTemplate;

//    @Override
//    public String hiService(String name) {
//        return restTemplate.getForObject("http://SERVICE-1/hi?name="+name,String.class);
//    }

    @Override
    @Cacheable(key="#name",value="userCache")
    public String hiService1(String name) {
        return "http://SERVICE-1/hi?name="+name + "," + System.currentTimeMillis();
    }

}